package at.fhj.antesk.steamvaluecalc.interfaces;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.swing.JProgressBar;
import javax.swing.JTable;

import at.fhj.antesk.steamvaluecalc.Game;
import at.fhj.antesk.steamvaluecalc.MainFrame;

public interface Retriever {

	/**
	 * Returns the price from a single Steam URL.
	 * 
	 * @param url
	 * @return
	 * @throws IOException
	 */
	public double retrievePriceFromUrl(String url) throws IOException;

	/**
	 * Retrieves the list of games for the given account name via XML.
	 * 
	 * @param account
	 * @return
	 */
	public List<Game> retrieveGameListForAccount(String account);

	/**
	 * Returns a two-dimensional array representation of a game list for use
	 * with a JTable.
	 * 
	 * @param gameList
	 * @return
	 */
	public String[][] createGameListArrayForTable(List<Game> gameList);

	/**
	 * Retrieves the prices for all games in the List<{@link Game}> and updates
	 * the progress bar and the table where they are shown.
	 * 
	 * @param gameList
	 * @param progressBar
	 * @param table
	 * @return
	 * @throws IOException
	 */
	public List<Game> retrievePricedGameListWithProgressBar(
			List<Game> gameList, JProgressBar progressBar, JTable table)
			throws IOException;

	/**
	 * Returns a nice representation of a double value with the currency
	 * specified in the values.properties.
	 * <p>
	 * Example: Input(2.98) Output = "2,98 \u20AC".
	 * 
	 * @param price
	 * @return
	 */
	public String formatDoubleToCurrency(double price);

	/**
	 * Returns a map of all the properties specified in values.properties.
	 * 
	 * @return
	 */
	public Map<String, String> getConfigsMap();

	/**
	 * Returns a map of all comma separated values specified in
	 * values.properties.
	 * 
	 * @return
	 */
	public Map<String, String[]> getCsvMap();

	public void setMainFrame(MainFrame mainFrame);
	
}
